import React from "react"
import { connect } from "react-redux"
import { bindActionCreators } from 'redux';
import { Button } from 'antd';
import * as actionsUser from "./reduxUser/actionsUser"

class ReactX0402 extends React.Component {
    constructor(props) {
        super(props);
        console.log(this.props)
    }

    render() {
        return (

            <div>
                <Button onClick={() => { this.props.counterActions.ADD_User(2) }} className="margin_right_sm" type="primary">增加user人数</Button>
            </div>

        )
    }
}
const mapStateToprops = (state) => {
    return {
        number: state.number,
        user:state.user
    }
}

const setStateToprops = (dispatch) => {
   
    return {
        counterActions: bindActionCreators(actionsUser, dispatch)
    }
}
//按照顺序
export default connect(mapStateToprops,setStateToprops)(ReactX0402) 